//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Company, CompanyResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCompanyList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CompanyResponse>(`/uctoo/company/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCompany = async (id: string) => {
  return requestClient.get<Company>(`/uctoo/company/${id}`);
};

export const adductooCompany = async (data: Partial<Company>) => {
  return requestClient.post<Company>('/uctoo/company/add', data);
};

export const edituctooCompany = async (data: Partial<Company>) => {
  return requestClient.post<Company>('/uctoo/company/edit', data);
};

export const deleteuctooCompany = async (id: string) => {
  return requestClient.post<any>('/uctoo/company/del', { id });
};
